CREATE TRIGGER trg_OrderCompleted
ON Orders
AFTER INSERT
AS
BEGIN
    DECLARE @product_id INT, @quantity INT
    SELECT @product_id = ProductID, @quantity = Quantity 
    FROM inserted

    EXEC sp_update_inventory @product_id, @quantity
END
